var enterFlag=true;
$(function() {
    $("#loginBtn").click(function () {
        var username=$("#username").val();
        var password=$("#password").val();
        $.ajax({
            url:base_url+"/dologin",
            type:"post",
            data:{
                "username":username,
                "password":password
            },
            success:function(data){
                enterFlag=true;
                if(data.code == SUCCESS_CODE){
                    window.location.href = base_url;
                }else{
                    warnMsgShow(data.message);
                }
            }
        });
    });
});

$(document).keyup(function(event){
    if(event.keyCode ==13){
        if(enterFlag){
            enterFlag = false
            $(".modal-backdrop").remove();
            $("#loginBtn").click();
        }
    }
});
